package cn.may.repository.student;

import cn.may.domain.student.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * @author mayuanbao
 * @date 2019-06-02 10:45
 */
@Repository(value = "studentDao")
public interface StudentDao extends JpaRepository<Student, Long> {
    Student findByName(String name);

    /**
     * fetch data by [id]
     * @author mayuanbao
     * @date 2019-06-04 17:16
     * @param id id
     * @return cn.may.domain.student.Student
     */

    Student findById(Integer id);
    /***
     * 通过id删除
     * @author mayuanbao
     * @date 2019-06-10 14:29
     * @param id id
     * @return int
     */

    int deleteById(Integer id);

}
